package edu.whu.demo.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import edu.whu.demo.domain.Comment;
import com.baomidou.mybatisplus.extension.service.IService;
import edu.whu.demo.domain.CommentDTO;
import edu.whu.demo.exception.CommentException;
import edu.whu.demo.exception.MessageException;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 
 * @since 2022-11-24
 */
public interface ICommentService extends IService<Comment> {

    Comment addComment(Comment comment) throws CommentException, MessageException;

    void deleteComment(Long id) throws CommentException;


    void updateComment(Long id, Comment comment) throws CommentException;

    // 返回什么类型？？
    Comment findComment(Long id) throws CommentException;

    /**
     * 获得某条一级评论及其下所有二级评论
     * @param id
     * @param pageNum
     * @param pageSize
     * @return
     */
    IPage<Comment> findDetailComments(Long id, Integer pageNum, Integer pageSize);

    List<CommentDTO> findComment2(Long id);

    void likeComment(Long id);

    void disLikeComment(Long id);

    IPage<CommentDTO> searchComment(Map<String, Object> condition, Integer pageNum, Integer pageSize);
}
